package com.gradle.demo;

import java.util.List;

import org.apache.ofbiz.base.util.UtilMisc;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.DelegatorFactory;
import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.condition.EntityCondition;


public class Demo {

	public static void main(String[] args) throws GenericEntityException {
		try {
			
			System.setProperty("ofbiz.home", "/Users/wuhuaping/Documents/Resources/wxshop/entityengine/gradledemo/");
			Delegator delegator = DelegatorFactory.getDelegator("default");

			List<GenericValue> valueList = delegator.findList("User2", null, null, UtilMisc.toList("loginName"), null, false);
			
			/*List<GenericValue> valueList = delegator.findList("TestingType", EntityCondition.makeCondition("description", ""),
					null, null, null, true);*/
			System.out.println(valueList.size()); 
			//System.out.println(Demo.class.getClassLoader().getResource(""));
		} catch (Exception e) {
			e.printStackTrace();
		}
		

	}
}
